From 5b3327347f83a473755b00a76ff1176dc6cda301 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Tue, 20 Mar 2007 17:36:18 +0000 Subject: [PATCH] Raise an exception in xm_block_detach if using Xen-API and it fails -- this ensures that the exit status properly set. Signed-off-by: Tom Wilkie --- tools/python/xen/xm/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index a138afdd95..66a5951f7f 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -1962,7 +1962,8 @@ def xm_block_detach(args): if len(server.xenapi.VDI.get_VBDs(vdi_ref)) <= 0: server.xenapi.VDI.destroy(vdi_ref) else: - print "Cannot find device '%s' in domain '%s'" % (dev,dom) + raise OptionError("Cannot find device '%s' in domain '%s'" + % (dev,dom)) else: try: detach(args, 'block-detach', 'vbd') -- 2.30.2